<?php
/**
 * Created by PhpStorm.
 * User: liuxiaojie
 * Date: 2019-06-18
 * Time: 16:09
 */

namespace app\mall\controller;

use app\common\BaseLoginCustomer;
use app\mall\service\AdminService;
use think\Request;

class Admin extends BaseLoginCustomer
{
    private $adminService;
    function __construct(Request $request = null, AdminService $adminService)
    {
        parent::__construct($request);
        $this->adminService = $adminService;
    }

    function lists()
    {
        $company_id = $this->getParam('company_id', 0);
        $data = $this->adminService->lists($company_id, $this->pageSize);
        return success($data);
    }

    function couponList()
    {
        $company_id = $this->getParam('company_id', 0);
        $data = $this->adminService->couponList($company_id, $this->pageSize);
        return success($data);
    }

    function member()
    {
        $param = [
            'm.parent_id'=> $this->getParam('u_id')
        ];

        $data = $this->adminService->member($param, $this->pageSize);
        return success($data);
    }

}